function formatTime(val, format) {
    if (isNumber(val) && (val + '').length === 10) {
        val = val * 1000
    }
    return dayjs(val, format)
}

function formatSeceondTimeVideo(val) {
    val = Math.round(val / 1000)
    if (val < 0) {
        val = Math.abs(val)
    }
    let sec = val % 60
    let min = Math.floor((val / 60) % 60)
    let hour = Math.floor(val / 3600)

    if (+sec < 10) {
        sec = `0${sec}`
    }

    if (+sec === 0) {
        sec = `00`
    }

    if (+min < 10) {
        min = `0${min}`
    }

    if (+min === 0) {
        min = `00`
    }

    if (+hour < 10) {
        hour = `0${hour}`
    }

    if (+hour === 0) {
        hour = null
    }
    let res = ''
    if (hour) {
        res = `${hour}:${min}:${sec}`
    } else {
        res = `${min}:${sec}`
    }

    return res
}
function isNumber(value) {
    return typeof value === 'number' && !isNaN(value)
}